import {Form, Button, Row, Col, DatePicker,Input,Select  } from 'antd';
import { campanys } from '../../utils/config';
import moment from 'moment';
const { RangePicker } = DatePicker;
const FormItem = Form.Item;

function query({form, onOk }){

  const {getFieldDecorator,getFieldsValue,resetFields} = form;
  const formItemLayout = {
    // labelCol: { span: 7 },
    wrapperCol: { span: 20 },
    colon:false,
  };
  const submit = (value) => {
    console.log('1  >>>>>',)
    const values = getFieldsValue(
      dispatch({
        type:'data/searchIntegral',
        payload:value
      })
    );
    console.log('2  >>>>>',)
    onOk(value);
  };

  return(
    <Form
      onSubmit={submit}
    >
        <Row>
        <Col span={8}>
          <FormItem
            {...formItemLayout}
          >
            {
              getFieldDecorator('area',)(
                <Select placeholder='区域'>
                         <Select.Option value='事业部'>事业部</Select.Option>
                         <Select.Option value='华东区'>华东区</Select.Option>
                         <Select.Option value='华南区'>华南区</Select.Option>
                         <Select.Option value='华北区'>华北区</Select.Option>
                </Select>
              )
            }
          </FormItem>
        </Col>
        <Col span={8}>
          <FormItem
            {...formItemLayout}
          >
            {
              getFieldDecorator('company',)(
                <Input size='large' placeholder='公司'/>
              )
            }
          </FormItem>
        </Col>
        <Col span={8}
          // style={{ textAlign: 'right'}}
        >
          <Button type='primary' size='large' icon='search' onClick={submit} style={{ marginRight: 20}}>查 看</Button>
        </Col>
      </Row>
    </Form>
  )
}

export default Form.create()(query);
